package com.ruoyi.house.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.house.mapper.YjzHouseImageMapper;
import com.ruoyi.house.domain.YjzHouseImage;
import com.ruoyi.house.service.IYjzHouseImageService;

/**
 * 房源图片Service业务层处理
 *
 * @author 码道可道
 * @date 2025-07-14
 */
@Service
public class YjzHouseImageServiceImpl extends ServiceImpl<YjzHouseImageMapper, YjzHouseImage> implements IYjzHouseImageService {
    @Autowired
    private YjzHouseImageMapper yjzHouseImageMapper;

    /**
     * 查询房源图片
     *
     * @param id 房源图片主键
     * @return 房源图片
     */
    @Override
    public YjzHouseImage selectYjzHouseImageById(Long id) {
        return yjzHouseImageMapper.selectYjzHouseImageById(id);
    }


    /**
     *  查找房源图片
     *  @param houseId 房源id
     *  @return 房源图片列表
     * */
    @Override
    public List<YjzHouseImage> selectHouseImage(Long houseId) {
        YjzHouseImage yjzHouseImage = new YjzHouseImage();
        yjzHouseImage.setHouseId(houseId);
        return yjzHouseImageMapper.selectYjzHouseImageList(yjzHouseImage);
    }
    /**
     * 查询房源图片列表
     *
     * @param yjzHouseImage 房源图片
     * @return 房源图片
     */
    @Override
    public List<YjzHouseImage> selectYjzHouseImageList(YjzHouseImage yjzHouseImage) {
        return yjzHouseImageMapper.selectYjzHouseImageList(yjzHouseImage);
    }

    /**
     * 新增房源图片
     *
     * @param yjzHouseImage 房源图片
     * @return 结果
     */
    @Override
    public int insertYjzHouseImage(YjzHouseImage yjzHouseImage) {
            return yjzHouseImageMapper.insertYjzHouseImage(yjzHouseImage);
    }

    /**
     * 修改房源图片
     *
     * @param yjzHouseImage 房源图片
     * @return 结果
     */
    @Override
    public int updateYjzHouseImage(YjzHouseImage yjzHouseImage) {
        return yjzHouseImageMapper.updateYjzHouseImage(yjzHouseImage);
    }

    /**
     * 批量删除房源图片
     *
     * @param ids 需要删除的房源图片主键
     * @return 结果
     */
    @Override
    public int deleteYjzHouseImageByIds(Long[] ids) {
        return yjzHouseImageMapper.deleteYjzHouseImageByIds(ids);
    }

    /**
     * 删除房源图片信息
     *
     * @param id 房源图片主键
     * @return 结果
     */
    @Override
    public int deleteYjzHouseImageById(Long id) {
        return yjzHouseImageMapper.deleteYjzHouseImageById(id);
    }
}